package com.io.testIO;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.LineHandler;
import cn.hutool.core.io.file.Tailer;
import cn.hutool.core.lang.Console;

/**
 * @Description : 类描述
 * Created by cyd on 2021-04-14 20:28:25
 */
public class TestTailer {
    public static class ConsoleLineHandler implements LineHandler {
        @Override
        public void handle(String line) {
            Console.log(line);
        }
    }

    public static void main(String[] args) {
        Tailer tailer = new Tailer(FileUtil.file("d:/readme.txt"), new ConsoleLineHandler(), 1);
        tailer.start();
        System.out.println("hello world");
    }
}
